package cn.wolfcode.mapper;

import cn.wolfcode.domain.Department;
import cn.wolfcode.domain.Role;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    // =====关系表插入数据======
    void saveRelation(@Param("roleId") Long roleId, @Param("permissionId") Long permissionId);

    Role selectByPrimaryKey(Long id);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);

    // 分页查询
//    int selectForCount(QueryObject qo); // 使用后端分页插件
    List<Role> selectForList(QueryObject qo);

    void deleteRelationById(Long id);

    List<Role> selectRolesById(Long id);
}